package com.neu.af.config;

import com.github.pagehelper.PageHelper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Properties;

@Configuration //相当于我们建了applicationContext-xxx.xml <beans></beans>
public class MyBatisConfiguration {
        @Bean
        public PageHelper getPageHelper(){
            PageHelper pageHelper=new PageHelper();
            Properties properties=new Properties();
            properties.setProperty("helperDialect","mysql");
            properties.setProperty("reasonable","true");
            properties.setProperty("supportMethodsArguments","true");
            properties.setProperty("params","count=countSql");
            pageHelper.setProperties(properties);
            return pageHelper;
        }
    }